from api_test.api.feishu_api import FeiShuApi
        

class DepartmentApi(xxxApi):
    def __init__(self):
        super().__init__()
        self.department_ids = []

    def search_department(self, query=None, id=None):
        path = "/open-apis/contact/v3/departments/search"
        payload = {
            "query": "query",
            "id": "id"
}
        res = self.send_request("POST", self.base_url + path, json=payload)
        # 判断请求结果
        if res.status_code == 200:
            self.json_data = res.json()
            if self.jsonpath(expr="$.code")[0] == 200:
                self.ids += self.jsonpath("$..id")
                print(f"\n检查结果: {self.ids}")
        else:
            print(res.status_code, res.text)
        